<?php # Блок службы поддержки

class support_service extends Load_use
{
	function getBlock()
	{
		if ( $this->view->templ == "product" )
		{
			$product_id = getProductById();
			if ( $product_id )
			{
				$this->conn->query( "SELECT value FROM store_product_xml_data data
									JOIN store_product_xml_data_relation rel ON rel.xml_data_id = data.id
										WHERE rel.product_code = '{$product_id->product_code}' and data.type = 'phone'" );

				$phone = $this->conn->fetch();
			}

			$product_phone = ( isset( $phone->value ) && $phone->value != '' ) ? $phone->value : '8 (495) 983 5 983';
		}
		else
			$product_phone = '8 (495) 983 5 983';
			
			
		//убрать после новогодних праздников, оставить просто с 09:00 до 21:00
		if( date("d F") == '23 February' ) {
			$work_time = 'с 09:00 до 19:00';
		}
		else
			$work_time = 'с 09:00 до 21:00';

		return '<div class="support-service">
					<ul class="support-service__inner centering">
						<li class="support-service__phone">
						
						<!--
							<address>
								<table>
									<tr>
										<td>
											<span>8 (495) 983 5 983</span>
											<small>доставка доб.2</small>								
											<small>монтаж и сервис доб.3</small>
										</td>
										<td>
											<span>8 (800) 700-5-983</span> 
											<small>с 09:00 до 14:00</small>
											<small>для регионов</small>
										</td>
									</tr>
									<tr>
										<td colspan="2">
											<small class="alert_message">
												В связи с проблемами на телефонной линии<br/>
												просим Вас  оформлять заказы через корзину
											</small>
										</td>
									</tr>
								</table>
							</address>	
						-->
							

							<address>
								<span>' . $product_phone . '</span>
								<small>доставка доб.2</small>								
								<small>монтаж и сервис доб.3</small>
							</address>
							<address>
								<span>8 (800) 700-5-983</span>
								<small>'.$work_time.'</small>
								<small>для регионов</small>
							</address>

						</li>
						<li class="support-service__online-consultant">
							<a href=\'javascript:void(window.open("http://raybt.ru/support/chat.php ","","width=590,height=610,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes"))\'>Онлайн консультант</a>
						</li>
						<li class="support-service__feedback">
							<a href="#feed_back" id="feed_back" class="show-popup open_modal_win">Обратная связь</a>
						</li>
						<li class="support-service__skype sublist_wrap">
							<span class="support-service_title">skype</span>
							
							<ul class="support-service_sublist sublist_skype">
								<!--<li><a href="skype:raybt_r20?add">Алексей</a></li>-->
								<li><a href="skype:khorikoff_anton?add">Антон</a></li>
								<li><a href="skype:raybt_r22?add">Екатерина</a></li>
							</ul>
						</li>
						<li class="support-service__socseti sublist_wrap">
							<span class="support-service_title">Мы есть в:</span>
							
							<ul class="support-service_sublist sublist_socseti">
								<li>
									<span class="support-service__vkontakte">&nbsp;</span>
									<a target="_blank" href="http://vk.com/ray_bt">vkontakte</a>
								</li>
								<li>
									<span class="support-service__facebook">&nbsp;</span>
									<a target="_blank" href="https://www.facebook.com/pages/%D0%A0%D0%B0%D0%B9%D0%91%D0%A2/557139094371159">facebook</a>
								</li>
								<li>
									<span class="support-service__twitter">&nbsp;</span>
									<a target="_blank" href="https://twitter.com/Ray_BT">twitter</a>
								</li>
							</ul>
						</li>
					</ul>
				</div>';
	}
}